package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维护-维护操作类型
type vehicleMaintainEditType int

var VehicleMaintainEditType vehicleMaintainEditType

// 客服提交
func (c *vehicleMaintainEditType) CsSubmit() int {
	return 1
}

// 工程部响应
func (c *vehicleMaintainEditType) EngineerReceive() int {
	return 2
}

// 部分维护
func (c *vehicleMaintainEditType) MaintainPart() int {
	return 3
}

// 全部维护
func (c *vehicleMaintainEditType) MaintainAll() int {
	return 4
}

// 检验
func (c *vehicleMaintainEditType) Verify() int {
	return 5
}

// 客户回访
func (c *vehicleMaintainEditType) CustomerReturnVisit() int {
	return 6
}

// 终止
func (c *vehicleMaintainEditType) Termination() int {
	return 7
}

// 重新开单
func (c *vehicleMaintainEditType) Reorder() int {
	return 8
}

func (c *vehicleMaintainEditType) ToText(value int) string {
	switch value {

	case 1:
		return "客服提交"

	case 2:
		return "工程部响应"

	case 3:
		return "部分维护"

	case 4:
		return "全部维护"

	case 5:
		return "检验"

	case 6:
		return "客户回访"

	case 7:
		return "终止"

	case 8:
		return "重新开单"

	}
	return ""
}

func (c *vehicleMaintainEditType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainEditType) ToValue(text string) int {
	switch text {

	case "客服提交":
		return 1

	case "工程部响应":
		return 2

	case "部分维护":
		return 3

	case "全部维护":
		return 4

	case "检验":
		return 5

	case "客户回访":
		return 6

	case "终止":
		return 7

	case "重新开单":
		return 8

	}
	return 0
}
